package Day10;

/**
 * @author HYHwtx
 * @version 1.0
 * @date 2022/2/16 9:01
 */
public class Demo01 {
    public static void main(String[] args) {
        //定义数组
       double[] array = {3,5,3.5,10,11,13};
       //遍历数组
        double totalWeight = 0;
        for (int i = 0; i < array.length; i++) {
            System.out.println("第"+(i+1)+"个元素的值为："+array[i]);
            totalWeight+=array[i];

        }
        System.out.println("总体重"+totalWeight+"平均体重"+totalWeight/array.length);
    }
}
